const app= getApp()
export default {
  props: {
    list: {
      type: Array,
      default: [1, 2, 3]
    },
    activeColor: {
      type: String,
      default: '#fff'
    },
    activeBgColor: {
      type: String,
      default: '#25262A'
    },
    inActiveColor: {
      type: String,
      default: '#333'
    },
    inActivebgColor: {
      type: String,
      default: '#F6F6F6'
    },
    //圆角
    radius: {
      type: Number,
      default: 0
    },
    //如果传递的是string类型，用","隔开
    value: {
      type: [Array, String],
      default: (val) =>{
        const { value } = val
        console.log(val);
        return typeof value == Array ? [] : ''
      }
    },
  },
  data() {
    return {
      values: [],
      defaultValue: this.value,
    }
  },
  watch: {
  },
  computed: {
  },
  mounted(){
  },
  methods: {
    //点击事件
    onTap(e) {
      const { id } = e.currentTarget.dataset
      this.list.forEach(i => {
        if (id == i.id) {
          i.isChecked = !i.isChecked;
        }
      });
    }
  }
}